<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<%@ include file="inc/head.jsp" %>
    
<title>用户列表管理</title>
</head>
<body>  
<!--Begin Header Begin-->
	
	<%@ include file="inc/head2.jsp" %>
	
	<%@ include file="inc/shopping.jsp" %>
	
<!--End Header End--> 
	<div class="i_bg bg_color">
	
    <div class="m_content">
        
	<%@ include file="inc/m_left.jsp" %>
	
	
	<div class="m_right" id="content">
	            <div class="mem_tit">用户列表</div>
	            <p align="right">
	                <a href="AddInfoSkipServlet" class="add_b">添加用户</a>
	                <br>
	            </p>
	            <br>
	          <table border="0" class="order_tab" style="width:930px; text-align:center; margin-bottom:30px;" cellspacing="0" cellpadding="0">
		<tbody>
		
			<tr>
				<td width="10%">用户名称</td>
				<td width="10%">真实姓名</td>
				<td width="5%">性别</td>
				<td width="5%">类型</td>
				<td width="5%" colspan="2">操作</td>
			</tr>
		<c:forEach items="${list}" var="item">
			<tr>
				<td>${item.loginName }</td>
				<td>${item.userName }</td>
				<td>
					<c:if test="${item.sex == 1 }">男</c:if>
					<c:if test="${item.sex == 0 }">女</c:if>
				</td>
				<td>
					
					<c:if test="${item.type == 1 }">管理员</c:if>
					<c:if test="${item.type == 0 }">用户</c:if>
				</td>
				<td><a href="${pageContext.request.contextPath }/UpdateUserInfoServlcet?id=${item.id}">修改</a></td>
				<td>
					<a href="javascript:;" onclick="del(${item.id})">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>  
	
	
	<script type="text/javascript">
	    var contextPath = "/EasyBuy";
	</script>
	<div class="pages">
	    		      <a href="#" class="p_pre">首页</a><a href="#" class="cur">1</a><a href="#">2</a><a href="#" class="p_pre">尾页</a>
	  
	</div>
	
	        </div></div>
</div> 
	
	<%@ include file="inc/footer.jsp" %>

</div>
<script type="text/javascript">
		function del(id){
			if(id == 2){
				alert("不好意思,你权限不足!");
			}else{
				if(confirm("确认删除吗")){
					window.location.href="${pageContext.request.contextPath}/DeleteUserInfoServlet?id="+id;
				}
			}
		}
	</script>
</body>

</html>
